<?php
/**
 * quick_curd
 * ============================================================================
 * 版权所有 2024-2099 wltx666.com，并保留所有权利。
 * 网站地址: https://wltx666.com
 * ============================================================================
 * Author: 草上飞
 * Email: wltx@alipay168.cn
 * QQ: 2719875001
 * Date: 2024/12/15
 * 描述:
 */

namespace app\middleware;


use think\facade\Route;

class AuthCheck
{
    public function handle($request, \Closure $next)
    {
        $header = $request->header();
        $isOptions = $request->isOptions();
        if (empty($isOptions)) {
            $url = $request->pathinfo();// 获取当前访问的route定义
            $ip = get_ip();
            $ipStatus = !in_array($ip, ['127.0.0.1', '0.0.0.0']);
            //bs_log(['url' => $url, 'ip' => $ip, 'ipStatus' => $ipStatus, 'header' => $header], 'info', 'admin_access_log.log');
        }
        return $next($request);
    }
}
